Access contracts: a dynamic approach to object-oriented access protection

نویسنده

  • Janina Voigt
چکیده

In object-oriented (OO) programming, variables do not contain objects directly but ad-dresses of objects on the heap. Thus, several variables can point to the same object; wecall this aliasing.Aliasing is a central feature of OO programming that enables efficient sharing of objectsacross a system. This is essential for the implementation of many programming idioms,such as iterators. On the other hand, aliasing reduces modularity and encapsulation,making programs difficult to understand, debug and maintain.Much research has been done on controlling aliasing. Alias protection schemes (suchas Clarke et al.’s influential ownership types) limit which references can exist, thus guar-anteeing the protection of encapsulated objects. Unfortunately, existing schemes aresignificantly restrictive and consequently have not been widely adopted by software de-velopers.This thesis makes three contributions to the area of alias protection. Firstly, it pro-poses aliasing contracts, a novel, dynamically-checked alias protection scheme for object-oriented programming languages. Aliasing contracts are highly flexible and expressive,addressing the limitations of existing work. We show that they can be used to modelmany existing alias protection schemes, providing a unifying approach to alias protection.Secondly, we develop a prototype implementation of aliasing contracts in Java anduse it to quantify the run-time performance of aliasing contracts. Since aliasing con-tracts are checked dynamically, they incur run-time performance overheads; however, ourperformance evaluation shows that using aliasing contracts for testing and debugging isnevertheless feasible.Thirdly, we propose a static analysis which can verify simple aliasing contracts atcompile time, including those contracts which model ownership types. Contracts whichcan be verified in this way can subsequently be removed from the program before it isexecuted. We show that such a combination of static and dynamic checking significantlyimproves the run-time performance of aliasing contracts.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Aliasing contracts: a dynamic approach to alias protection

Object-oriented programming languages allow multiple variables to refer to the same object, a situation known as aliasing. Aliasing is a powerful tool which enables sharing of objects across a system. However, it can cause serious encapsulation breaches if not controlled properly; through aliasing, internal parts of aggregate objects can be exposed and potentially modified by any part of the sy...

متن کامل

Dynamic Alias Protection with Aliasing Contracts

Object-oriented languages allow any object to point to any other object, limited only by type. The resultant possible aliasing makes programs hard to verify and maintain. Much research has been done on alias protection schemes to restrict aliasing. However, existing schemes are either informal (design-patternlike) or static type-like systems. The former are hard to verify, while the latter tend...

متن کامل

JSConTest: Contract-Driven Testing and Path Effect Inference for JavaScript

Program understanding is a major obstacle during program maintenance. In an object-oriented language, understanding an operation requires understanding its type and its effect on the object network. The effect is particularly important for scripting languages where there is neither class structure that restricts the shape of an object nor any other kind of access control. We have designed and i...

متن کامل

Object-Oriented Design Pattern: Access Protector

Access Protector is a class behavioral design pattern which distributes the routines of the original class hierarchy to given access-protection layers. The distribution utilizes dynamic binding and automatic upcasting to guarantee that the indended object access policies are transitive while the original runtime behavior between the objects does not change. In more detail, the pattern states ex...

متن کامل

Flexible Aliasing with Protection

Unwanted effects of aliasing cause encapsulation problems in object oriented programming. Nevertheless, aliasing is part of common and efficient programming techniques for expressing sharing of objects and as such its general restriction is not an option in practice. We present an approach that allows full referential object sharing, but adds access control to object references to limit the eff...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015